import axios from 'axios'
axios.defaults.baseURL = 'http://www.520gongfu.com:9527/api'

// 轮播图
export const getSliders = (callback) => {
  // console.log(callback);
  axios.get('/home/sliders').then(function(response){
    // console.log(response);
    callback && callback(response.data)
  })
  .catch(function(error){
    console.log(error);
  })
}

// 首页分类导航
export const homeCategory = (callback) => {
  axios.get('/home/category').then(function(response){
    callback && callback(response.data)
  })
  .catch(function(error){
    console.log(error);
  })
}

// 首页商品数据
export const homeFloorList = (callback) => {
  axios.get('/home/floorlist').then(function(response){
    callback && callback(response.data)
  })
  .catch(function(error){
    console.log(error);
  })
}